arithmetic types (1) | ostream& operator<< (bool val);ostream& operator<< (short val);ostream& operator<< (unsigned short val);ostream& operator<< (int val);ostream& operator<< (unsigned int val);ostream& operator<< (long val);ostream& operator<< (unsigned long val);ostream& operator<< (float val);ostream& operator<< (double val);ostream& operator<< (long double val);ostream& operator<< (void* val); |
---|---|
stream buffers (2) | ostream& operator<< (streambuf* sb ); |
manipulators (3) | ostream& operator<< (ostream& (*pf)(ostream&));ostream& operator<< (ios& (*pf)(ios&));ostream& operator<< (ios_base& (*pf)(ios_base&)); |
arithmetic types (1) | ostream& operator<< (bool val);ostream& operator<< (short val);ostream& operator<< (unsigned short val);ostream& operator<< (int val);ostream& operator<< (unsigned int val);ostream& operator<< (long val);ostream& operator<< (unsigned long val);ostream& operator<< (long long val);ostream& operator<< (unsigned long long val);ostream& operator<< (float val);ostream& operator<< (double val);ostream& operator<< (long double val);ostream& operator<< (void* val); |
---|---|
stream buffers (2) | ostream& operator<< (streambuf* sb ); |
manipulators (3) | ostream& operator<< (ostream& (*pf)(ostream&));ostream& operator<< (ios& (*pf)(ios&));ostream& operator<< (ios_base& (*pf)(ios_base&)); |
<<
) applied to an output stream is known as insertion operator. It is overloaded as a member function for:pf(*this)
, where pf may be a manipulator.manipulator | Effect |
---|---|
endl | Inserts a new-line character and flushes the stream. |
ends | Inserts a null character. |
flush | Flushes the stream. |
boolalpha / noboolalpha | Activates/deactivates the insertion of bool values as their alphanumerical representations. |
showbase / noshowbase | Activates/deactivates the insertion of base prefixes in the representations of integer values. |
showpoint / noshowpoint | Activates/deactivates the requirement that the decimal point is always written on the representations of floating-point values. |
showpos / noshowpos | Activates/deactivates the requirement that positive values are preceded with a plus sign (+ ). |
unitbuf / nounitbuf | Activates/deactivates automatic flushing after each insertion operation. |
uppercase / nouppercase | Activates/deactivates the use of uppercase letters for characters used in the representations of arithmetic types. |
dec / hex / oct | basefield setting: Sets that base used to represent integral numerical values. |
fixed / scientific / hexfloat / defaultfloat | floatfield setting: Format used to represent floating-point values. |
internal / left / right | adjustfield setting: Position where fill characters are inserted to adjust the field to the field width. |
manipulator | Effect |
---|---|
setbase | Sets the numerical base used to represent integral numerical values . |
setfill | Sets the fill character used to adjust fields to the field width. |
setprecision | Sets the decimal precision used to represent floating-point values. |
setw | Sets the field width used by the next formatted insertion. |
setiosflags/resetiosflags | Set/reset format flags. |
*this
).flag | error |
---|---|
eofbit | - |
failbit | The function failed to format val (it may also be set if the construction of sentry failed). For (2), it is set if no characters could be extracted from the object pointed by sb. |
badbit | Either the insertion on the stream failed, or some other error happened (such as when this function catches an exception thrown by an internal operation). When set, the integrity of the stream may have been affected. For (2), it is also set if sb is a null pointer. |
|
|
65 |